<div data-extend-template="components/views/bst-modal.html">
  <h4 data-block="modal-header">Content Host Traces Management</h4>

  <div data-block="modal-body">

    <div class="row">
      <div class="col-sm-12">
        <div bst-global-notification></div>
      </div>
    </div>

    <div bst-alert="info" ng-hide="remoteExecutionPresent">
      <span translate>
        The Remote Execution plugin needs to be installed in order to resolve Traces.
      </span>
    </div>
    
    <div data-extend-template="layouts/partials/table.html">
      <div data-block="search" ng-show="false"></div>
      <span data-block="list-actions">
        <div bst-modal="performViaRemoteExecution()" model="rebootRequired">
          <div data-block="modal-header" translate>Confirm services restart</div>
          <div data-block="modal-body">
            <span translate>Are you sure you want to restart the services on the selected content hosts?</span>
            <span ng-show="rebootRequired()">
              <strong translate>Resolving the selected Traces will reboot this host.</strong>
            </span>
          </div>
          <span data-block="modal-confirm-button">
            <button class="btn btn-danger" ng-click="ok()">
              <span translate>Restart</span>
            </button>
          </span>
        </div>
  
          <span class="btn-group">
            <button class="btn btn-danger" type="button"
                    translate
                    ng-hide="denied('edit_hosts', host)"
                    ng-disabled="table.getSelected().length == 0 || !remoteExecutionPresent"
                    ng-click="openModal()">
              Restart Selected
            </button>
          </span>
      </span>
  
      <span data-block="no-rows-message" translate>
        There are no Traces to display.
      </span>
  
      <div data-block="table">
        <div data-extend-template="layouts/select-all-results.html"></div>
        <table bst-table="table" class="table table-striped table-bordered" ng-class="{'table-mask': table.working}">
          <thead>
            <tr bst-table-head row-select>
              <th bst-table-column="application" translate>Application</th>
              <th bst-table-column="app_type" translate>Type</th>
              <th bst-table-column="helper" translate>Helper</th>
              <th bst-table-column="affected_hosts" translate>Hostname</th>
            </tr>
          </thead>
          <tbody>
            <tr bst-table-row ng-repeat="trace in table.rows" row-select="trace">
              <td bst-table-cell >{{ trace.application }}</td>
              <td bst-table-cell >{{ trace.app_type }}</td>
              <td bst-table-cell >{{ trace.helper }}</td>
              <td bst-table-cell >{{ trace.host }}</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
  <div data-block="modal-footer">
    <button type="button" class="btn btn-primary" ng-click="cancel()" translate>
      Cancel
    </button>
  </div>
</div>
